class CreateReviews < ActiveRecord::Migration
  def self.up
    create_table :reviews do |t|
      t.integer :user_id, :null => false
      t.text :review, :null => false
      t.string :title, :null => false
      t.integer :rating
      t.integer :item_id, :null => false
      t.string :item_type, :null => false
      t.timestamps
    end

    add_foreign_key(:reviews, :users, :column => :user_id)
  end

  def self.down
    drop_table :reviews
  end
end
